Skip to content

Instantly share code, notes, and snippets.

View ceelsoin's full-sized avatar
🏠
Working from home

Celso Inácio ceelsoin

🏠
Working from home
View GitHub Profile
@ceelsoin
ceelsoin / export_commits.sh
Last active February 1, 2019 12:37
Export commit log to multiple projects
#!/bin/bash
repos=($(ls -d */))
for index in "${!repos[@]}"
do
cd "${repos[$index]}"
if [ -e ".git" ]
then
repoName=${repos[$index]//\//""}
@ceelsoin
ceelsoin / typescript-csv.ts
Last active February 20, 2020 20:05
Typescript generate and download csv by object
public convertArrayOfObjectsToCSV(args) {
var result, ctr, keys, columnDelimiter, lineDelimiter, data;
var filter = args.filter || [""]; //default fields to exclude
data = args.data || null;
if (data == null || !data.length) {
return null;
}
columnDelimiter = args.columnDelimiter || ';';
@ceelsoin
ceelsoin / FileUpload.cs
Last active May 10, 2019 18:15
C# multipart/form-data upload
public static async Task sendScreenShotResult(string fullPath, string game_code)
{
LogHandler _LogHandler = new LogHandler();
try
{
var url = Config.HOST + "/api/battle/sendScreenShotResult/" + game_code;
string filename = Path.GetFileName(fullPath);
string CT = "image/jpeg";
FormUpload.FileParameter f = new FormUpload.FileParameter(File.ReadAllBytes(fullPath), filename, "multipart/form-data");
Dictionary<string, object> d = new Dictionary<string, object>();
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Example</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script>
// http://www.selfcontained.us/2009/09/16/getting-keycode-values-in-javascript/
keycode = {
getKeyCode : function(e) {
# remove specific file from git cache
git rm --cached filename
# remove all files from git cache
git rm -r --cached .
git add .
git commit -m ".gitignore is now working"
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var elements = document.body.getElementsByTagName('*');
var items = [];
for (var i = 0; i < elements.length; i++) {
if (elements[i].innerHTML.indexOf('* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }') != -1) {
items.push(elements[i]);
}
}
.hidden {
visibility: hidden;
}
.loader-overlay {
position: fixed;
width: 100%;
height: 100vh;
// z-index: 1000;
background-color:rgba(0,0,0,0.5);
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ceelsoin
ceelsoin / public-stun-list.txt
Created October 26, 2019 20:03 — forked from mondain/public-stun-list.txt
Public STUN server list
23.21.150.121:3478
iphone-stun.strato-iphone.de:3478
numb.viagenie.ca:3478
s1.taraba.net:3478
s2.taraba.net:3478
stun.12connect.com:3478
stun.12voip.com:3478
stun.1und1.de:3478
stun.2talk.co.nz:3478
stun.2talk.com:3478
@ceelsoin
ceelsoin / media-query.css
Created December 7, 2019 15:18 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS