Skip to content

Instantly share code, notes, and snippets.

View tsolar's full-sized avatar

Tomás Solar Castro tsolar

  • Santiago, Chile
View GitHub Profile
@anlek
anlek / application.scss
Last active April 30, 2020 13:51
My current work around for simple_form and Bootstrap 4 beta to work together (till simple_form allows input fields to have `is-invalid` set on it on error - see https://github.com/plataformatec/simple_form/pull/1476)
// Fix for validations on simple form
// Need to import bootstrap functions and mixins if you want to dynamically set colors
// Otherwise replace theme-color... with hex color
@import 'bootstrap/functions';
@import 'bootstrap/variables';
@import 'bootstrap/mixins';
.has-invalid {
.invalid-feedback {
@pierremonico
pierremonico / Postman.desktop
Last active April 27, 2023 11:52 — forked from aviskase/Postman.desktop
Install Postman
[Desktop Entry]
Encoding=UTF-8
Name=Postman
Exec=postman
Icon=/opt/Postman/resources/app/assets/icon.png
Terminal=false
Type=Application
Categories=Development;
@aviskase
aviskase / Postman.desktop
Last active November 21, 2023 20:56
Install Postman
[Desktop Entry]
Encoding=UTF-8
Name=Postman
Exec=postman
Icon=/home/USERNAME/Postman/app/resources/app/assets/icon.png
Terminal=false
Type=Application
Categories=Development;
@netzfisch
netzfisch / post_policy_spec.rb
Created June 26, 2014 13:51
RSpec example for rails authorisation with Pundit's policy_scope method
describe PostPolicy do
let(:scope) { Post.where(:published => true }
subject(:policy_scope) { PostPolicy::Scope.new(user, scope).resolve }
permissions ".scope" do
context "for an ordinary user"
let(:user) { User.new(:admin => false) }
it "hides unpublished post" do
post = Post.create(:published => false)
@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@pablomp
pablomp / SFTP-Filezilla.md
Last active May 4, 2024 16:03
Utilización de FileZilla para SFTP utilizando fichero de claves (Windows)
@evildmp
evildmp / gist:3094281
Last active June 30, 2023 10:55
Set up Django, nginx and uwsgi

This document has now been incorporated into the uWSGI documentation:

http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

Set up Django, nginx and uwsgi

Steps with explanations to set up a server using:

@willmot
willmot / wordpress.vcl
Created July 4, 2012 15:48
WordPress Varnish VCL
backend default {
.host = "127.0.0.1";
.port = "8444";
}
sub vcl_recv {
# Allow the back-end to serve up stale content if it is responding slowly.
set req.grace = 2m;
@esimionato
esimionato / awesome-gnome3
Created October 28, 2011 16:30
Awesome with Gnome 3
1. System Settings -> System Info -> Graphics -> Forced Fallback Mode ON
2. .gnomerc in your $HOME
export WINDOW_MANAGER=/usr/local/bin/awesome-wm
3. /usr/local/bin/awesome-wm
#!/bin/sh
awesome &
4. /usr/share/gnome-session/sessions/awesome.session
[GNOME Session]
Name=Awesome session
RequiredComponents=gnome-settings-daemon;
@katylava
katylava / git-selective-merge.md
Last active February 27, 2024 10:18
git selective merge

Update 2022: git checkout -p <other-branch> is basically a shortcut for all this.

FYI This was written in 2010, though I guess people still find it useful at least as of 2021. I haven't had to do it ever again, so if it goes out of date I probably won't know.

Example: You have a branch refactor that is quite different from master. You can't merge all of the commits, or even every hunk in any single commit or master will break, but you have made a lot of improvements there that you would like to bring over to master.

Note: This will not preserve the original change authors. Only use if necessary, or if you don't mind losing that information, or if you are only merging your own work.