Skip to content

Instantly share code, notes, and snippets.

View vivirenremoto's full-sized avatar
🍗

vivirenremoto vivirenremoto

🍗
View GitHub Profile
@javilobo8
javilobo8 / download-file.js
Last active April 9, 2024 12:01
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);
@nemotoo
nemotoo / .gitattributes
Last active May 2, 2024 18:33
.gitattributes for Unity3D with git-lfs
## Unity ##
*.cs diff=csharp text
*.cginc text
*.shader text
*.mat merge=unityyamlmerge eol=lf
*.anim merge=unityyamlmerge eol=lf
*.unity merge=unityyamlmerge eol=lf
*.prefab merge=unityyamlmerge eol=lf
@underdown
underdown / auto-follow-twitter.js
Last active August 4, 2023 20:20
auto follow twitter
a = setInterval(function () {
window.scrollTo(0,document.body.scrollHeight);
$('.not-following .user-actions-follow-button.js-follow-btn').click();
}, 4000);
/* changed setinterval to 4k ms - original source here https://medium.com/@karanjthakkar/how-i-grew-from-300-to-5k-followers-in-just-3-weeks-2436528da845
Just browse to someones follower list, hit F12 on chrome and plug this snippet into the console tab and hit enter
@fesja
fesja / fix emails
Created July 5, 2013 15:39
Patterns of bad written emails and the fix
$patterns = array(
'.con' => '.com',
'.col' => '.com',
'.cok' => '.com',
'.coj' => '.com',
'.cim' => '.com',
'.om' => '.com',
'.como' => '.com',
'.comm' => '.com',
'.comu' => '.com',
@jonathanmoore
jonathanmoore / gist:2640302
Created May 8, 2012 23:17
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@raulfraile
raulfraile / gist:1261181
Created October 4, 2011 08:53
Colorear errores Symfony2 + Twig + Twitter Bootstrap
{% block field_row %}
<div class="clearfix{% if errors|length > 0 %} error{% endif %}">
...
{% endblock %}
@benmcnelly
benmcnelly / AndroidManifest.custom.xml
Created July 9, 2011 21:23
AndroidManifest.custom.xml >> Install Location to enable app 2 SD
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="auto"
android:versionCode="2"
android:versionName="2"
package="com.whatever.whatwhatever"
>
Here's how to extract data out of a Google Doc spreadsheet.
Here's our victim...
http://spreadsheets.google.com/ccc?key=pUetVbUnXgLbDjatWZKjVAw
Note - If you are interested, you can sign up here: http://tr.im/gHHS
Now go to the Google OAuth Playground.