View diamond.c
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 <stdio.h> | |
int main() | |
{ | |
char *str = " ************"; | |
for (int i = 0 i < 20; i++) printf("%.*s\n", i/4%2==0?i % 4 + 5:9-i%4, i/4%2==0?str + i % 4:str+4-i%4); | |
return 0; | |
} |
View package.json
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
{ | |
"name": "datepicker", | |
"version": "1.0.0", | |
"description": "another datepicker", | |
"main": "src/index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"build": "webpack", | |
"dev": "webpack-dev-server" | |
}, |
View traverse_dir.c
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 <stdio.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <sys/dir.h> | |
#include <dirent.h> | |
int traverse_dir(char *path, int level, int (*callback)(struct dirent *, int)) | |
{ | |
DIR *handle = opendir(path); | |
int path_len; |
View show_binary_and_hex_of_a_number.c
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 <stdio.h> | |
#include <stdlib.h> | |
#include <limits.h> | |
#include <regex.h> | |
#define TOTAL_TYPE_PATTERNS 2 | |
enum number_type{ | |
TYPE_INT, | |
TYPE_FLOAT, |
View gist:4fcfca6b039aa61731741ce390270496
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
# start | |
sudo launchctl load /Library/LaunchDaemons/org.jenkins-ci.plist | |
# stop | |
sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist |
View gist:bcc1193e28b606f003cbb77ccf5333f4
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 | |
/** | |
* Split PDF file | |
* | |
* <p>Split all of the pages from a larger PDF files into | |
* single-page PDF files.</p> | |
* | |
* @package FPDF required http://www.fpdf.org/ | |
* @package FPDI required http://www.setasign.de/products/pdf-php-solutions/fpdi/ |
View response_now.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
ignore_user_abort(true); | |
set_time_limit(0); | |
ob_start(); | |
// do initial processing here | |
echo $response; // send the response | |
header('Connection: close'); | |
header('Content-Length: '.ob_get_length()); | |
ob_end_flush(); | |
ob_flush(); |
View paper-like-div.css
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
box-shadow: 2px 2px 20px rgba(0,0,0,0.5); | |
-webkit-box-shadow: 2px 2px 20px rgba(0,0,0,0.5); | |
-moz-box-shadow: 2px 2px 20px rgba(0,0,0,0.5); |