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
mysql -Nsr -e "SELECT t.table_name FROM INFORMATION_SCHEMA.TABLES t WHERE t.table_schema = 'DB_NAME'" | xargs -I {} mysql DB_NAME -e "ALTER TABLE {} AUTO_INCREMENT = 1;" |
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
$OutputEncoding = New-Object -typename System.Text.UTF8Encoding | |
[Console]::OutputEncoding = New-Object -typename System.Text.UTF8Encoding |
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 exec = require('child_process').exec, | |
url = "http://google.com/", | |
timeout = "3", | |
data="?q=test"; | |
var time = process.hrtime(); | |
exec('curl --max-time ' + timeout + ' -d \'' + data + '\' ' + url, function (error, stdout, stderr) { | |
var diff = process.hrtime(time); | |
//console.log('stdout: ' + stdout); | |
//console.log('stderr: ' + stderr); |
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
/** | |
* Get the date and days within a week from week number. | |
* eg: date range for 8th week in 2013 is 17th Feb to 23rd Feb. This | |
* code snippet will give you. | |
* | |
* It is not my code completely, Bit of modification from something | |
* i found on net. Cant find it anymore so keeping a backup. | |
* | |
* @param {[Integer]} weekNo [From week 1 to Week 52/53 based on the system date setting] | |
* @return {[Date]} [description] |
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
<?php | |
/** | |
* Giving myself more functionality over this bit | |
* | |
* @author byrd | |
* | |
*/ | |
class BetterXML extends SimpleXMLElement | |
{ | |
/** |
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
{% if app.session.flashbag.peekAll|length > 0 %} | |
{% for type, messages in app.session.flashbag.all %} | |
{% for message in messages %} | |
<div class="{{ type ? type : '' }}"> | |
{{ message|trans({}, domain|default('messages')) }} | |
</div> | |
{% endfor %} | |
{% endfor %} | |
{% endif %} |
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 | |
import socket | |
import sys | |
if (len(sys.argv) != 2 or not sys.argv[1].isdigit()): | |
print 'Usage: listen <port>', | |
exit() | |
p = int(sys.argv[1]) | |
l = [] |
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
xgettext --default-domain=messages -p locale --from-code=UTF-8 -n --omit-header -L PHP $(find /tmp/cache -name "*.php") |
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.cards.notification"> | |
<uses-sdk | |
android:minSdkVersion="17" | |
android:targetSdkVersion="17" /> | |
<application | |
android:allowBackup="true" |
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
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |