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
/* FORM MODERNIZE */ | |
input, select { vertical-align: middle; } | |
/* Buttons */ | |
input[type="button"], | |
input[type="submit"], | |
button { | |
background: -webkit-linear-gradient(top, #ffffff, #dddddd); | |
background: -moz-linear-gradient(top, #ffffff, #dddddd); | |
background: linear-gradient(top, #ffffff, #dddddd); |
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 wrap_text($txt, $color = 000000, $space = 4, $font = 2, $w = 300, $h = 300) | |
{ | |
if (strlen($color) != 6) | |
$color = 000000; | |
$int = hexdec($color); | |
$fw = imagefontwidth($font); | |
$txt = explode("\n", wordwrap($txt, ($w / $fw) -2, "\n")); | |
$lines = count($txt); |
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
def viewWillAppear(animated) | |
@foreground_observer = App.notification_center.observe UIApplicationWillEnterForegroundNotification do |notification| | |
// call method here | |
end | |
end | |
def viewWillDisappear(animated) | |
App.notification_center.unobserve @foreground_observer | |
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
Teacup::Stylesheet.new :create_screen do | |
# Input Fields | |
style :input_text_wrapper, | |
left: 24, | |
image: UIImage.imageNamed('ui-textfield-normal.png'), | |
userInteractionEnabled: true, | |
width: 249 | |
style :input_text_type, |
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 'mongo' | |
require 'json' | |
include Mongo | |
@client = MongoClient.new('localhost', 27017) | |
@db = @client['school'] | |
@students = @db['students'] | |
@students.find().each { |student| |
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 | |
class FTP { | |
/** | |
* Download() performs an automatic syncing of files and folders from a remote location | |
* preserving folder and file names and structure | |
* | |
* @param $local_dir: The directory to put the files, must be in app path and be writeable | |
* @param $remote_dir: The directory to start traversing from. Use "." for root dir |
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
BEGIN | |
SET @ID = 1; | |
WHILE @ID < 100 DO | |
UPDATE wp_posts SET comment_count = (SELECT COUNT('ID') FROM wp_comments WHERE comment_post_ID = @ID) WHERE ID = @ID; | |
SET @ID = @ID + 1; | |
END WHILE; | |
UPDATE wp_posts SET post_date = (SELECT FROM_UNIXTIME(post_time)); | |
UPDATE wp_posts SET post_date_gmt = (SELECT FROM_UNIXTIME(post_time)); |
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
package main | |
import ( | |
"crypto/aes" | |
"crypto/cipher" | |
"fmt" | |
) | |
func main() { | |
input := []byte("this is a test") |
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 'uri' | |
require 'net/http' | |
require 'net/https' | |
require 'base64' | |
input = "this is a test" | |
iv = "532b6195636c6127" | |
key = "532b6195636c61279a010000" | |
puts "Input: [" + input.bytes.join(" ") + "]" |
OlderNewer