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
$('div[name="modules_div"]').each(function(){ | |
id = $(this).attr('id') | |
$('#' + id + ' table tbody').children().each(function(k, v){ | |
i = 0; | |
text = ''; | |
$(this).children().each(function(){ | |
if(i == 0){ | |
text = $(this).text() |
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
#include <unistd.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <errno.h> | |
int main() { | |
long cpu_online = -1; | |
long cpu_max = -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
find . -name 'version.php' -path '*wp-includes/*' -print -exec grep '$wp_version =' {} \; -exec echo '' \; |
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 | |
function A2N($alphabet) { | |
$alphabet = strtoupper($alphabet); | |
$result = -(ord($alphabet) - 69); | |
return $result > 0 && $result <= 4 ? $result : 0; | |
} | |
function calculateGPA($grades) { |
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/sh | |
sudo apt-get install apache2-prefork-dev libxml2 libxml2-dev apache2-dev | |
mkdir ~/modbuild/ && cd ~/modbuild/ | |
wget http://apache.webthing.com/svn/apache/filters/mod_xml2enc.c | |
wget http://apache.webthing.com/svn/apache/filters/mod_xml2enc.h | |
sudo apxs2 -aic -I/usr/include/libxml2 ./mod_xml2enc.c | |
cd ~ | |
sudo rm -rfd ~/modbuild/ | |
sudo service apache2 restart |
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 | |
function A2N($alphabet) { | |
// if alphabet like AB, BA.. | |
if (strlen($alphabet) > 1) { | |
$result = 0; | |
foreach (str_split($alphabet) as $chr) { | |
$result += A2N($chr); | |
} | |
return $result / count(str_split($alphabet)); |
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
CHESS Engine Categorized | |
by strong | |
- Stockfish | |
- Gull | |
- Fruit | |
- GNU Chess | |
by Comment / Clean Code / didactic | |
- Crafty |
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
# install openjdk | |
sudo apt-get install openjdk-7-jdk | |
# download android sdk | |
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz | |
tar -xvf android-sdk_r24.2-linux.tgz | |
cd android-sdk-linux/tools | |
# install all sdk packages |
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 namespace App\Http\Middleware; | |
use Closure; | |
use Illuminate\Contracts\Routing\Middleware; | |
use Illuminate\Http\Response; | |
class CORS implements Middleware { | |
/** | |
* Handle an incoming request. |
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
# virtualenv auto activation | |
function cd { | |
builtin cd "$@" | |
DEACTIVATE_TYPE="function"; | |
DEACTIVATE_EXIST=$(type -t deactivate); | |
if [ -d ".venv" ] | |
then | |
source .venv/bin/activate #auto activate | |
else | |
if [ "$DEACTIVATE_EXIST" == "$DEACTIVATE_TYPE" ]; then deactivate; fi #auto deactivate |
OlderNewer