Skip to content

Instantly share code, notes, and snippets.

View jmilagroso's full-sized avatar
⌨️
ps aux | grep stress | awk '{print $2}' | xargs kill -9

jmilagroso jmilagroso

⌨️
ps aux | grep stress | awk '{print $2}' | xargs kill -9
  • PH
View GitHub Profile
@jmilagroso
jmilagroso / acceleration
Last active August 29, 2015 14:02
acceleration
http://mathhelpforum.com/math-topics/18767-acceleration-question.html
The catapult of the aircraft carrier USS Abraham Lincoln accelerates an F/A-18 Hornet jet fighter
from rest to a takeoff speed of 173 mi/h in a distance of 307 ft . Assume constant acceleration.
-Calculate the acceleration of the fighter in m/s^2 .
-Calculate the time required for the fighter to accelerate to takeoff speed.
173 mph = Vf = 77.33792 m/s {Google conversion}
307 ft = d = 93.5736 meters {Google conversion}
@jmilagroso
jmilagroso / mysqltrigger
Last active August 29, 2015 14:02
MySQL Trigger On Delete
DELIMITER $$
CREATE TRIGGER after_delete_on_table_a AFTER DELETE ON table_a
FOR EACH ROW
BEGIN
DELETE FROM table_b WHERE table_b.foreign_id = old.id;
END
@jmilagroso
jmilagroso / SQLiteUpperCase
Created June 18, 2014 04:59
Update first letter in a given column data.
UPDATE tb_Company
SET CompanyIndustry = CONCAT(UCASE(LEFT(CompanyIndustry, 1)),
SUBSTRING(CompanyIndustry, 2));
@jmilagroso
jmilagroso / Velocity
Created June 18, 2014 05:01
Mach to KpH
1 Mach = 340.29 m / s
1 m/s = 3.6 km/h
1.5 Mach = 510.435 m/s
((510.435 m/s)x(3.6 km/h))/(1m/s) = 1837.566 km/h
FA-50 Velocity is 1837.566 km/h
@jmilagroso
jmilagroso / MySQLToCSV
Created June 18, 2014 05:05
Export data as CSV
SELECT * INTO OUTFILE 'C:/export/users.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
ESCAPED BY '\\'
LINES TERMINATED BY '\n'
FROM users;
@jmilagroso
jmilagroso / .gitignore
Last active August 29, 2015 14:02 — forked from octocat/.gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
#!/usr/bin/env bash
echo ">>> Starting Install Script"
# Update
sudo apt-get update
# Install MySQL without prompt
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
@jmilagroso
jmilagroso / public_access_policy
Created January 27, 2015 07:33
AWS S3 Bucket Public Access Policy
{
"Version":"2012-10-17",
"Statement":[{
"Sid":"PublicReadGetObject",
"Effect":"Allow",
"Principal": "*",
"Action":["s3:GetObject"],
"Resource":["arn:aws:s3:::example-bucket/*"
]
}
@jmilagroso
jmilagroso / EventDate
Created March 18, 2015 06:27
EventDate class helper.
<?php
/**
* EventDate class helper.
*
* @author Jay Milagroso<j.milagroso@gmail.com>
*/
class EventDate {
// Today
Route::get('redis', array('as' => 'cache', 'do' => function()
{
$redis = Redis::connection();
//STRING
$redis->set('name', 'Taylor');
$name = $redis->get('name');
// LIST
// A list is a series of ordered values. Some of the important commands for interacting with lists are RPUSH, LPUSH, LLEN, LRANGE, LPOP, and RPOP.