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 | |
$dbc = mysql_connect('HOSTNAME','USERNAME','PASSWORD'); | |
if (!$dbc){ | |
die(mysql_error()); | |
} | |
$db_selected = mysql_select_db('DATABASE',$dbc); | |
if(!$db_selected){ | |
die(mysql_error()); | |
} |
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"?> | |
<inputList> | |
<inputConfig type="keyboard"> | |
<input name="a" type="key" id="13" value="1" /> | |
<input name="b" type="key" id="8" value="1" /> | |
<input name="down" type="key" id="274" value="1" /> | |
<input name="left" type="key" id="276" value="1" /> | |
<input name="menu" type="key" id="32" value="1" /> | |
<input name="pagedown" type="key" id="304" value="1" /> | |
<input name="pageup" type="key" id="0" value="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
input_player1_b = s | |
input_player1_a = a | |
input_player1_y = z | |
input_player1_x = x | |
input_player1_l = q | |
input_player1_r = w | |
input_player1_start = space | |
input_player1_select = lalt | |
input_player1_up = up | |
input_player1_down = down |
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
$(window).load(function(){ | |
adbuddiz.isReadyToShowAd( | |
function() { alert('SDK Loaded'); }, | |
function() { alert('SDK Not Loaded') } | |
); | |
adbuddiz.showAd(); | |
}); |
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
function buy(price) { | |
// Do your magic here | |
// And track the transaction here: | |
var token = "XXXXXXXXX" // Token found at EduData. | |
var tag = "TAG_NAME" // Give the tag a name. | |
var host = "HOST_NAME" // If using a backend server you can insert your hostname here. | |
var values = [parseInt(price)] // Array of values, in this case just the price of the item. | |
var unit = '$' // Set a unit for your measurement, you can leave an empty string. |
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
// In app.js or main.js or whatever: | |
// var myApp = angular.module('askchisne', ['ngSanitize', 'ngAnimate', 'ui.bootstrap', 'ui.bootstrap.tpls']); | |
// This filter makes the assumption that the input will be in decimal form (i.e. 17% is 0.17). | |
myApp.filter('percentage', ['$filter', function ($filter) { | |
return function (input, decimals) { | |
percentage = $filter('number')(input * 100, decimals); | |
percentage = percentage.toString().replace(/(\.[0-9]*?)0+$/, "$1").replace(/\.$/, ""); | |
return percentage + '%'; | |
}; |
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
awesome_files = [] # This will contain all the files we wanted | |
directories = ['app/models/'] # Initial directory to search | |
directories.each do |directory| # Iterate through the directories | |
files = Dir.glob("#{directory}/**") # Get all files and directories inside that directory | |
files.each do |file| # Iterate | |
next if file == '.' or file == '..' # Ignore . and .. | |
if File.directory?(file) # Check if the file is a directory or just a file | |
directories << file # If it's a directory, push it into the directories array to search inside it later | |
else | |
awesome_files << file # If it's a file save it |
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
require 'json' | |
require 'typhoeus' | |
class UrlCharts | |
def initialize(key = nil) | |
if !key || key.empty? | |
raise 'No API key defined.' | |
else | |
@api_key = key |
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
class GoogleCharts | |
def self.url(options = {}) | |
chs = options[:size] || "250x100" | |
chd = options[:data] || "t:60,40" | |
cht = options[:type] || "p3" | |
chl = options[:labels] || "You|Me" | |
url = "https://chart.googleapis.com/chart?chs=#{chs}&chd=#{chd}&cht=#{cht}&chl=#{chl}" | |
end |
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 MAC address | |
ifconfig en0 | grep ether | |
# Set a new MAC address | |
sudo ifconfig en0 ether aa:bb:cc:dd:ee:ff | |
# Set random MAC | |
openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//' | xargs sudo ifconfig en0 ether | |
# Save energy |
OlderNewer