Skip to content

Instantly share code, notes, and snippets.

View nfq's full-sized avatar

Nathan Querido nfq

View GitHub Profile
@josephhainline
josephhainline / convert_github_md_to_gitlab_format.sh
Created May 10, 2015 02:30
If you have repos in github that you'd like to port to gitlab, with all branches and tags, this will do it. If you want to port your wikis too, this will also work, although it's only a 90% solution for wikis. Github and gitlab use different file name and markdown conventions. Run the command port_repos_and_wikis_from_github_to_gitlab.sh to get …
#!/bin/bash
echo
echo "Processing all *.md files in current directory..."
echo
# Loop through all .md files in directory and rename spaces to dashes
for file in *" "*; do
echo "Renaming $file"
mv -- "$file" "${file// /-}"
@vielhuber
vielhuber / .htaccess
Last active February 24, 2023 06:01
Apache: htaccess force www and https ssl #server
# force HTTPS and www.
RewriteEngine On
RewriteCond %{HTTP_HOST} (?!^www\.)^(.+)$ [OR]
RewriteCond %{HTTPS} off
RewriteRule ^ https://www.%1%{REQUEST_URI} [R=301,L]
# alternative way
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
@gabrielhpugliese
gabrielhpugliese / gulpfile.js
Last active January 31, 2019 09:08
Django collectstatic + Gulp watch
var gulp = require('gulp');
var shell = require('gulp-shell');
var changed = require('gulp-changed');
gulp.task('collectstatic', function () {
return gulp.src('static/**/*.*')
.pipe(changed('YOURAPP/static/'))
.pipe(shell([
'python manage.py collectstatic --noinput'
@hellobrian
hellobrian / Vanilla-JavaScript-Tabs-with-visibility-hidden-visible.markdown
Last active October 25, 2015 00:03
Vanilla JavaScript Tabs with visibility hidden/visible
@koistya
koistya / React-Directory-Layout.md
Last active March 16, 2025 12:27
File and folder naming convention for React.js components

File and folder naming convention for React.js components

Directory Layout #1

/actions/...
/components/common/Link.js
/components/common/...
/components/forms/TextBox.js
/components/forms/TextBox.res/style.css
@pburtchaell
pburtchaell / styles.css
Last active February 12, 2025 08:45
VH and VW units can cause issues on iOS devices. To overcome this, create media queries that target the width, height, and orientation of iOS devices.
/**
* VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units
*
* To overcome this, create media queries that target the width, height, and orientation of iOS devices.
* It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing
* the height of element `.foo` —which is a full width and height cover image.
*
* iOS Resolution Quick Reference: http://www.iosres.com/
*/
@mikedugan
mikedugan / gulpfile.js
Created June 23, 2014 01:44
Basic gulpfile setup to minify images, LESS/CSS, and JS
var gulp = require('gulp');
var rimraf = require('rimraf');
var less = require('gulp-less');
var concat = require('gulp-concat');
var prefixer = require('gulp-autoprefixer');
var cssmin = require('gulp-minify-css');
var jsmin = require('gulp-uglify');
var watch = require('gulp-watch');
var util = require('gulp-util');
var rename = require('gulp-rename');
@hdragomir
hdragomir / sm-annotated.html
Last active February 2, 2025 02:22
The deferred font loading logic for Smashing Magazine. http://www.smashingmagazine.com/
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
@TheFox
TheFox / jsframeworks.md
Last active December 20, 2016 02:28
JavaScript Framework Collection

JavaScript Framework Collection

A collection of very nice JavaScript frameworks for developer.

Name Description
algorithms.js [S] Classic algorithms and data structures implemented in JavaScript, you know... FOR SCIENCE.
AngularJS [S] HTML enhanced for web apps.
Backbone.js [S] Backbone supplies structure to JavaScript-heavy applications by providing models key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing application over a RESTful JSON interface.
beeplay.js [S][H] Write A Song On JavaScript.
@sergejmueller
sergejmueller / ttf2woff2.md
Last active March 9, 2024 13:37
WOFF 2.0 – Learn more about the next generation Web Font Format and convert TTF to WOFF2