This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::vector<std::string> split_line(std::string str, std::string sub) | |
{ | |
std::vector<std::string> vector_split_line; | |
std::string split_line = ""; | |
std::string sub_line = ""; | |
bool skip = false; | |
for ( int current_char = 0; current_char < str.length(); current_char++ ) | |
{ | |
if ( str[current_char] == sub[0] ) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import smtplib | |
import sys | |
class gmail(object): | |
"""docstring for gmail""" | |
def __init__( self, username, password ): | |
self.username = username | |
self.password = password | |
self.login() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python | |
from PIL import Image | |
import sys | |
import os | |
imageFile = sys.argv[1] | |
file_name = imageFile.split(".")[0] | |
ext = imageFile.split(".")[-1] | |
sizes = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import MySQLdb | |
db_config = { | |
"host":"localhost", | |
"username":"username", | |
"password":"password", | |
"name":"name_of_database" | |
} | |
def query( query, bindings = False ): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.intel.camerawebserver" > | |
<uses-permission android:name="android.permission.INTERNET" | |
android:required="true" /> | |
<uses-feature android:name="android.hardware.camera" | |
android:required="true" /> | |
<application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var image_video = function image_video ( id ) | |
{ | |
this.image_element = document.getElementById( id ); | |
this.page = this.image_element.src; | |
this.running = false; | |
return this; | |
} | |
image_video.prototype.get_image = function get_image ( page, callback ) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Run as root | |
touch /etc/init.d/startvms | |
chmod +x /etc/init.d/startvms | |
update-rc.d startvms defaults 99 01 | |
cat <<'EOF' >> /etc/init.d/startvms | |
#! /bin/sh | |
# /etc/init.d/startvms | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
char swap_bits( char byte, int one, int two ) | |
{ | |
char tmp_1, tmp_2, swap; | |
int hex_1 = pow(2, one); | |
int hex_2 = pow(2, two); | |
tmp_1 = byte & hex_1; | |
tmp_1 = tmp_1 >> abs( one - two ); | |
tmp_2 = byte & hex_2; | |
tmp_2 = tmp_2 << abs( one - two ); | |
if ( tmp_1 == 0 && tmp_2 != 0 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerName something.example.com | |
ProxyRequests Off | |
<Proxy *> | |
Order deny,allow | |
Allow from all | |
</Proxy> | |
ProxyPass / http://server:port/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ffmpeg -i ${1}.srt ${1}.ass | |
ffmpeg -i ${1}.mp4 -vf ass=${1}.ass ${1}_subtitles.mp4 |
OlderNewer